package com.action.login;

import com.opensymphony.xwork2.*;
import java.util.*;

public class LoginAction extends ActionSupport {

	private String id;
	private String pwd;

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public void setPwd(String pwd) {
		this.pwd = pwd;
	}

	public String execute() throws Exception {

		Map session = ActionContext.getContext().getSession();
		session.put("login", id);
		return SUCCESS;

	}

	public String logout() throws Exception {

		Map session = ActionContext.getContext().getSession();
		session.remove("login");

		return SUCCESS;
	}
}
